package com.example.demo.sys.service.bo;

import com.alibaba.fastjson.JSONObject;
import com.example.demo.sys.entity.Dic;

import lombok.Data;

@Data
public class DicBO {
	private String name;
	private JSONObject data;
	
	public static DicBO convert(Dic dic) {
		if(dic == null) {
			return null;
		}
		DicBO bo = new DicBO();
		bo.setName(dic.getName());
		JSONObject data = JSONObject.parseObject(dic.getData());
		bo.setData(data);
		return bo;
	}
}
